package utils;

import org.apache.commons.lang.StringUtils;

public class HtmlUtil {
	public static String rhtml(String content) {
	    if(StringUtils.isBlank(content))
	        return content;
	    String html = content;
	    html = StringUtils.replace(html, "&", "&amp;");
	    html = StringUtils.replace(html, "<", "&lt;");
	    html = StringUtils.replace(html, ">", "&gt;");
	    html = StringUtils.replace(html, "\"", "'");
	    return html;
	}
	
	public static String rhtmlDout(String content) {
	    if(StringUtils.isBlank(content))
	        return content;
	    String html = content;
	    html = StringUtils.replace(html, "\"", "'");
	    html = StringUtils.replace(html, ";", "; ");
	    return html;
	}
}
